//#define __DEBUG__
// by Xeno
#define THIS_FILE "x_m44.sqf"
#include "x_setup.sqf"
private ["_hangar", "_poss", "_vehicle", "_lvec"];

_mpos = markerPos QGVAR(sm_544);
_mpos set [2,0];
_mpos2 = markerPos QGVAR(sm_544_1);
_mpos2 set [2,0];
GVAR(x_sm_pos) = [_mpos, _mpos2]; // index: 44,   Steal chopper prototype at Almyra
GVAR(x_sm_type) = "normal"; // "convoy"

#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client && {!GVAR(IS_HC_CLIENT)}) then {
	GVAR(cur_sm_txt) = (localize "STR_DOM_MISSIONSTRING_863");
	GVAR(current_mission_resolved_text) = (localize "STR_DOM_MISSIONSTRING_796");
};

if (call FUNC(checkSHC)) then {
	__PossAndOther
	// _hangar = createVehicle [GVAR(sm_hangar2), _poss, [], 0, "NONE"];
	// _hangar setDir (markerDir QGVAR(sm_544));
	// _hangar setPos _poss;
	// __AddToExtraVec(_hangar)
	// sleep 1.0123;
	_vehicle = createVehicle [GVAR(sm_chopper), _poss, [], 0, "NONE"];
	//_vehicle setDir ((direction _hangar) + 180);
	_vehicle setDir (markerDir QGVAR(sm_544));
	_vehicle setPos _poss;
	sleep 2.123;
	["specops", 2, "basic", 4, _poss,200,true] spawn FUNC(CreateInf);
	sleep 2.221;
	["shilka", 1, "bmp", 1, "tank", 1, _pos_other,1,400,true] spawn FUNC(CreateArmor);
	sleep 2.543;
	[_vehicle] spawn FUNC(sidesteal);
	_vehicle addMPEventHandler ["MPKilled", {if (isServer) then {[_this select 0, _this select 1, 0] call FUNC(sidempkilled)}}];
	_vehicle setDamage 0;
};
